<template>
    <div>
        <h1 class="HOME">HOME PAGE</h1> 
        <button @click="goHot">去热点</button>
        <button @click="goPlayers">去玩家页面</button>
    </div>
</template>

<script setup>
// import router from "../router";
import { useRouter } from "vue-router"

const router = useRouter()  // 创建路由器实例对象

const goHot = () =>{
    // console.log(router);
    // router.push({path:'/hot',query:{id:1}})
    router.push({name:'hot',params:{id:1}})
}
const goPlayers =() =>{
    console.log(router);
    router.push('/player')
    // router.replace('/player')
}
</script>

<style lang="css" scoped>
.HOME{
    text-align: center
}
</style>